// import VueRouter from  'vue-router';// vue2 导入方式

// vue3 函数式编程
import { createRouter, createWebHashHistory } from "vue-router";

// 路由映射表（定义 path 和 component 的关系）
const routes = [
    {
        path: "/", // 浏览器默认的行为，默认会在 /
        redirect: "/home",
    },
    {
        path: "/home",
        name: 'home',
        component: () => import("../pages/Home/index.vue"),
    },
    {
        path: "/company",
        name: 'company',
        component: () => import("../pages/Company/index.vue"),
    },
    {
        path: "/message",
        name: 'message',
        component: () => import("../pages/Message/index.vue"),
    },
    {
        path: "/mine",
        name: 'mine',
        component: () => import("../pages/Mine/index.vue"),
    },

];
const router = createRouter({
    // mode  vue2 设置路由的模式
    // vue3 设置路由的模式
    history: createWebHashHistory(),
    routes,
});

export default router;